package com.wing.wcabinet.model.response;

import com.wing.cabinet.model.entity.CabinetCargoLane;
import com.wing.cabinet.model.entity.CellInventorySpace;
import com.wing.cabinet.utils.ExcelExport;
import com.wing.product.model.entity.ProductType;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.wing.wcabinet.model.entity.WcabCellInventorySpace;
import java.math.BigDecimal;

/**
 * 售刀柜产品货道库存VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class WcabCellInventorySpaceVO {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime createTime;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 柜子id
     */
    private Long cabId;

    /**
     * 货道id
     */
    private Long spaceId;

    /**
     * sku id
     */
    private Long skuId;

    /**
     * 库存数量
     */
    private Integer quantity;

    /**
     * 重量
     */
    private BigDecimal weight;

    /**
     * skuCode
     */
    private String skuCode;

    /**
     * spaceCode
     */
    private String spaceCode;

    /**
     * cabCode
     */
    private String cabCode;

    /**
     * 是否已同步：no(0,未同步);yes(1,已同步);
     */
    private Integer isSyns;

    /**
     * 是否同步
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime synsTime;

    /**
     * enterpriseId
     */
    private Long enterpriseId;

    /**
     * enterpriseCode
     */
    private String enterpriseCode;

    /**
     * 业务类型
     */
    private WcabCellInventorySpace.BusinessType businessType;

    /**
    * 业务类型描述
    */
    @TableField(exist = false)
    private String businessTypeDesc;

    public String getBusinessTypeDesc() {
        if(this.businessType!=null){
            return businessType.getDesc();
        }
        return null;
    }

    /**
     * sku 名称
     */
    @ExcelExport(value = "物料名称",sort = 3)
    private String skuName;

    /**
     * 状态
     */
    private CellInventorySpace.Status status;

    /**
     * 状态描述
     */
    @TableField(exist = false)
    private String statusDesc;

    public String getStatusDesc() {
        if (status!=null){
            return status.getDesc();
        }
        return null;
    }

    /**
     * sku 规格
     */
    private String skuSpec;

    /**
     * sku 图片
     */
    private String skuPic;

    /**
     * 产品名称
     */
    private String productName;

    /**
     * 产品类型名称
     */
    private String productTypeName;

    /**
     * 产品分类名称
     */
    private String productCategoryName;

    /**
     * 产品品牌
     */
    private String productBrandName;

    /**
     * 产品型号
     */
    private String productModelName;

    /**
     * 适配机床
     */
    private String deviceName;

    /**
     * 市场价
     */
    private BigDecimal marketPrice;

    @ExcelExport(value = "最大库存",sort = 7)
    private Integer quantityMax;

    @ExcelExport(value = "单位",sort = 8)
    private String unitName;

    /**
     * 当前库存
     */
    private Long curentStock;

    /**
     * 告警库存
     */
    private Long alarmStock;

    /**
     * 计划补货
     */
    private Long planReplenishment;

    /**
     * 建议补货
     */
    private Long proposalStock;

    /**
     * 货道数量
     */
    private int cargoLaneNum;

    private String skuCodeOld;

    @ExcelExport(value = "规格码",sort = 5)
    private String skuSpecOld;

    private Boolean showPriceFlag=true;


    private BigDecimal maxBearing;

    private String cabName;

    private BigDecimal baseWeight;


    private CabinetCargoLane.SpaceType spaceType;

    private ProductType.WeightUnit weightUnit;


    public String getWeightUnitName(){
        if (this.weightUnit!=null){
            return this.weightUnit.getDesc();
        }
        return "";
    }

    private BigDecimal skuWeightUnit;

    private BigDecimal weightInventory;

    public BigDecimal getWeightInventory(){
        return this.weight;
    }



    private String weightUnitDesc;

    public String getWeightUnitDesc(){
        if (this.weightUnit!=null){
            return this.weightUnit.getDesc();
        }
        return "";
    }



    private String quantityUnitDesc;

    public String getQuantityUnitDesc(){
        return this.unitName;
    }



    private BigDecimal weightMax;

    private String oldSpecCode;

}
